<%-- 
    Document   : addv030
    Created on : Jul 30, 2012, 3:14:19 PM
    Author     : ems
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/jquery.fancybox-1.3.4.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
          <link rel="stylesheet" type="text/css" href="../css/reset.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>
        
        <script type="text/javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
                 
                $j('.keysearch').live('keyup',function(){
                    $j('.rich-table-row').hide();
                    $j('.rich-table-row').each(function(){
                        html = $j(this).html();
                        // alert( ununicode(html));  || html.indexOf( $j('.keysearch').val()) > -1
                        if(   html.indexOf( $j('.keysearch').val()) > -1    )  {
                            $j(this).show();
                        }else{
                            $j(this).hide();
                        }

                    });
                });

            });
            
            $j('.returnAdd').live('click',function(){
               // $j('.popup-content').css('display','block');
                $j('.find').css('display','none');
                $j('.addMain').css('display','block');
                $j('.action').css('display','none');
                
            });
            
            $j('.returnFind').live('click',function(){
                $j('.find').css('display','block');
                $j('.popup-content').css('display','none');
                $j('.action').css('display','block');
                $j('.addMain').css('display','none');
            });
            
//            $j('.contactN950').live('click',function(){
//                      //  alert('Thong tin lien lac');
//                        object = $j(this).next();
//                        var pn100ED  =$j('.customer-box').attr("lang");                        
//                        var pn100KH = $j('#formKHCN\\:pn100').val();                     
//                      //  alert('Thong tin lien lac - pn100ED: '+pn100ED + " - pn100KH: "+pn100KH );
//                       
//                        $j.post("contactCRM.jsp?action=editajaxpage&pn100="+ pn100KH+"&table=N100", function(data){
//                            alert('abc');
//                            $j('.customer-boxcontact').html(data);
//                        });
//                         
//                        
//                    
//                    });
              
              
//                    $j('.acountT025').live('click',function(){
//                        object = $j(this).next();
//                        var pn100KH = $j('#formKHCN\\:pn100').val();   
//                        $j.post("accountCRM.jsp?action=editajaxpage&pn100="+pn100KH+"&tv026=N100",function(data){
//                            $j('.customer-boxacount').html(data);
//                        }) ;
//                    
//                    });
//                
//                    $j('.customerK100').live('click',function(){
//                        object = $j(this).next();
//                        var pn100KH = $j('#formKHCN\\:pn100').val(); 
//                        $j.post("customerdemo.jsp?action=editEmp&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
//                            $j('.customer-boxcustomer').html(data);
//                        });
//                    
//                    });
//                
//                    $j('.infoN350').live('click',function(){
//                        object = $j(this).next();
//                        var pn100KH = $j('#formKHCN\\:pn100').val(); 
//                        $j.post("passportCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
//                            $j('.customer-boxN350').html(data);
//                        });
//                    
//                    });
//                      $j('.companyCRM').live('click',function(){
//                        object = $j(this).next();
//                      var pn100KH = $j('#formKHCN\\:pn100').val(); 
//                         $j.post("companyCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
//                            $j('.customer-companyCRM').html(data);
//                        }) ;
//                    
                    
                    
                    

        </script>
        <style type="text/css">
            .alert1111{
                float:left;color: red;
                float: left;
                height: 20px;
                line-height: 20px;
                margin-bottom: 10px;
                margin-left: -100px;
                margin-top: 10px;
                max-height: 30px;
                overflow: hidden;
                position: absolute;
                text-align: center;
                width: 200px;
            }
            .bg_department{
                height: 68px !important;
            }
            .feild_sex td label{
                color:#4C4C4C;
            }
            #ui-datepicker-div
            {
                z-index: 9999999;
            }
            .alert{
                width:200px;
                height:20px;
                max-height:30px;
                overflow: hidden;
                float: left;
                line-height: 20px;
                font-weight: bold;
                text-align:center;
                color:red;
                margin-bottom: 10px;
                margin-top: 10px;
                position: absolute;
                margin-left: 209px;
            }

            .alert2{
                width:200px;
                height:20px;
                max-height:30px;
                overflow: hidden;
                float: left;
                line-height: 20px;
                text-align:center;
                color:red;
                margin-bottom: 10px;
                margin-top: 10px;
                position: absolute;
                margin-left: 209px;
            }

            .alert1{
                width:200px;
                height:20px;
                max-height:30px;
                overflow: hidden;
                float: left;
                line-height: 20px;
                text-align:center;
                color:red;
                margin-bottom: 10px;
                margin-top: 10px;
                position: absolute;
                margin-left: 209px;

            }
            .alertC{
                width:200px;
                height:20px;
                max-height:30px;
                overflow: hidden;
                float: left;
                line-height: 20px;
                font-weight: bold;
                text-align:center;
                color:red;
                margin-bottom: 10px;
                margin-top: 10px;
                margin-left: -100px;      
            }

            .buttonsavecmnd{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
            }

            .buttonsaveContact{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
            }
            .buttonsaveCompany{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
            }
            .buttonsaveCompany1{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
                display: none;
            }
            .buttonsaveAccount{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
            }
            .fast_search1{

                margin-left: 100px;
            }
            .text_search1{

            }
            .fast_search1 input[type="text"]{
                height: 26px;
                width:300px;
                border: 1px solid #138EF9;
                border-radius: 4px ;
                float:left;

            }
            .fast_search1 a img{
                cursor: pointer;
                height: 34px;
                margin-left: 5px;
                width: 45px;
                border-radius: 4px ;

            }
            .buttonsearch1{
                font-weight: bold;
                border:0;          
                width:56px; height:24px;
                color:#ffffff;
                border-radius: 2px 3px 2px 3px;
                cursor:pointer;
                text-transform:uppercase;
                background-color: #526171;
            }
          
            .title labe{
                width:23px;
            }
            .sort_char1 label{
                width:21px ;
                text-align: center;
            }
            .sort_char1 {
                text-align: center;
                font-size: 11px ;
                margin-right: 0 ;
            }
            .sort_char1 a{
                border: 1px solid #82A6C7  ;
                color: #266DB3 ;
                cursor: pointer ;
                display: inline-block ;
                line-height: 20px ;

            }
            .research{
                border: 0.5px solid #CCCCCC;
                float: left;
                width:100%;
                height: auto;
              
                margin-bottom: 10px;
            }
            .namecompany{
                float:left;
                width:50% 
            }
            .carew{
                float:left;
                width:50% 
            }
            .idd{
                color: white;
            }
            .addcarew{
                display:none;
            }
            .addcarew1{
                display:block;
            }
            .congty{
                width:300px;
            }
            .button{
                float: left;
                width:100%;
                height: 40px;
            }
            #addmobi{
                float: left;
                margin-left: 3px;
                margin-top: 3px;
            }

            #addmobi img{
                height: 15px;
                width:14px;

            }
            #unaddmobi{
                float: left;
                margin-left: 3px;
                margin-top: 2px;
            }

            #unaddmobi img{
                height: 17px;
                width:14px;

            }
            #addtel{
                height: auto !important;
                margin-bottom: 4px !important;
            }
            #TextBoxesGroup{
                float: left;
            }

            #TextBoxDiv2{
                margin-left: 90px;
                margin-top: 14px !important;
            }
            #TextBoxDiv3{
                margin-left: 90px;
                margin-top: 44px !important;
            }
            #addtelcom{
                margin-left: 53px;
            }
            #addtelcom select{
                border: 1px solid #B2B7BB;
                height: 24px;
                width: 51px;
            }

            #fancybox-wrap{

            }
            .fields_input{
                float:left;
                width:100%;

                height:28px;
            }
            .button-link{
                border:0;
                background:url(../images/bg_submit.gif) repeat-x;
                width:134px;
                float:right;
                margin:19px 0 10px 0;
                color:#ffffff;
                font-size:14px;
                cursor:pointer;
                border-radius:5px;
                box-shadow:0 2px 3px #666666;
                padding:8px 0;
                text-transform:uppercase;
            }
            .customer-box{
                float:left; 
                width:714px; 
                margin-left:25px;                    
                border:1px solid #CCCCCC;
                padding:18px 0px 10px 0px;
                background: #E5E8EA;
                border-top: none;

            }
            .customer-box label{
                width:90px;
                text-align: right;
                float:left;
                font-size:12px;
            }
            input{
                float:left;
                margin-left:9px;
            }
            select{
                float:left;
                height: 21px;
                width:178px;
                margin-left:9px;
            }
            .ui-datepicker-header select{
                width:45% !important;
            }
            .header-box{
                margin-left:25px;
                color:#263340;
                margin-top:10px;
                float: left;
                cursor:pointer;
                padding:4px 0px 0px 4px; 
                width:710px;
                border:1px solid #CCCCCC;
                font-size:12px;
                background: #D4D7D8;
                height: 21px;
                font-weight: bold;
            }
            .fixdate .ui-datepicker-trigger  { margin-left: 4px;}

            .boder-bomttom{

            }
       
            .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
         
            .returnFind{
                background: url("../images/btn_search3.png") no-repeat scroll 0 0 transparent;
                cursor: pointer;
                height: 20px;
                margin-left: 732px;
                margin-top: 3px;
                position: absolute;
                width: 20px;
            }
          
            .buttonsearch2 {
                background: url("../images/bg_submit.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                border-radius: 2px 2px 2px 2px;
                color: #FFFFFF;
                cursor: pointer;
                font-size: 10px;
                font-weight: bold;
                margin-bottom: 10px;
                margin-left: 5px !important;
                margin-right: 0;
                margin-top: 0 !important;
                padding: 4px 0;
                text-transform: uppercase;
                width: 68px;
            }
            .popup-footer .buttonsave3{
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                font-weight: bold;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px ;
                -moz-border-radius:0px !important;
                -webkit-border-radius:0px !important;
                display:block;
            }
        </style>
        
        <script type="text/javascript" language="javascript">
                var open_cur = 0;
                $j = jQuery.noConflict();
                $j(document).ready(function(){

                    initThickBox('.thickbox');
                 
                   
                    $j('.keysearch').live('keyup',function(){
                        if($j('.keysearch').val() == ""){
                            $j('.rich-table-row').show();
                                   
                        }else{
                            $j('.rich-table-row').hide();
                            $j('.rich-table-row').each(function(){
                                html = $j(this).html();
                                if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                    $j(this).show();
                                }else{
                                    $j(this).hide();
                                }
                            });
                        }

                    });
                    $j(".checkAll").live("click",function(){
                        flag = $j('.checkAll').is(':checked');

                        $j(".check_select").each(function(){
                            $j('.check_select')  .attr('checked', flag);
                        });


                    });
                    $j(".rich-table-row:odd").addClass("odd");
                    
                    // Begin Event load ajax form CRM
                   
                    
                    // End Event load ajax form CRM for Dashbord
                    // Show hide form customerInputExpand from Customer
                    $j('.header-box').live('click', function(){               
                        if($j(this).next('.customer-box').css('display') != 'none'){
                            return;
                        }else{
                            //var PN100=$j('#form-input-customerform\\:PN100').val();
                            var PN100 = $j('#formKHCN\\:pn100').val(); 
                            if(PN100 != 0)
                            {
                                $j('.messa').hide();
                                $j('.customer-box').slideUp();                         
                                $j('.boder-bomttom').removeClass('boder-bomttom');
                                $j(this).next('.customer-box').slideDown();
                                $j(this).addClass('boder-bomttom');
                            } else{                        
                                $j('.messa').show();
                                $j(this).next('.customer-box').css('display') != 'none'
                            }
                           
                        }

                    });
                    $j('.vv031').live('click',function(){
                        $j(this).parents('.group_manager').parents('.item').find('.edit_more').find('.select_hidden').find('.menu-context-tour').trigger('click');
                    });
                });
            </script>
            <script type="text/javascript" language="javascript">
                var open_cur = 0;
                $j = jQuery.noConflict();
                $j(document).ready(function(){
                    //search client
                    //searchClient();
                   
                    $j('.text_search').live('keyup',function(){
                        if($j('.text_search').val() == ""){
                        
                            $j('.item').show();
                            $j('.close').trigger('click');   
                        }else{
                            $j('.close').trigger('click');
                            $j('.item').hide();
                            $j('.item').each(function(){
                                html = $j(this).html();
                                if(   ununicode(html).indexOf(  ununicode($j('.text_search').val()) ) > -1    )  {
                                    $j(this).show();
                                }else{
                                    $j(this).hide();
                                }
                            });
                        }

                    });
                    //
                    initThickBox('.thickbox');
                    $j('.st_horizontal').slideTabs();
                    Tab4Kapi();
                    $j('a.button.edit').live('click',function() {
                     
                        $j(this).parent("div").parent("div").hide().next("div").show();
                    
                    });
                   
                    $j(".rateit").bind('rated', function (event, value) { 
                        pn100 = $j(this).attr('lang');
                        
                        star_value = value;
                       
                        $j.post("star.jsp?action=favourite&flag=star&ni105="+star_value+'&pn100='+pn100,function(){
                        
                        });
                    });
             
                    $j('.search_box').hide();       
                    $j('.sidebar_search').live('click',function(){
                        $j('.search_box').hide();
                        if($j(this).next().hasClass('active')){

                            $j('.search_box').removeClass('active');
                        }else{

                            $j('.search_box').removeClass('active');
                            $j(this).next().addClass('active');
                            $j(this).next().show();
                        }
                    });
                    $j(".content_right").live("click",function(){
                        $j('.search_box').hide();
                    });
                    //                    $j(".choise_groups").live("click",function(){
                    //                        pn100 = $j(this).attr("lang");
                    //                       
                    //                        $j.post("listGroup.jsp?action=groupCus&pn100="+pn100,function(data){
                    //                            if(data!=null) {
                    //                                $j(".group_list_cus").html(data);
                    //                                                       
                    //                            }
                    //                        });  
                    //                    });
                    //save column V030
                    $j(".updateV500").live("click",function(){
                        pn100 = $j(this).parent(".group_list_cus_tour").attr('lang');
                        pv050 = $j(this).attr('lang');
                        vv031 = $j(this).text();
                      
                        $j.post('v030Begin.jsp?action=updateV030&pn100='+pn100+'&pv050='+pv050+'&vv031='+vv031,function(data){
                            if(data!= null){
                                hidePleaseWait(); 
                                window.location.href="customer.jsp";
                            }
                        });
                        
                        
                    });
                    $j(".updateq400").live("click",function(){
                        pn100 = $j(this).parent(".group_list_cus").attr('lang');
                       
                        pk400 = $j(this).attr('lang');
                        kv401 = $j(this).text();
                        showPleaseWait();
         
                        $j.post('k400Begin.jsp?action=updateK400N&pn100='+pn100+'&pk400='+pk400+'&kv401='+kv401,function(data){
                            if(data!= null){
                                hidePleaseWait(); 
                            }
                        });
                    
                    });
                    
                   
                }); 
            </script>
            <style type="text/css">
                .vv031{
                    cursor: pointer;
                    color:#0055A6;
                }
                .odd{
                    background: #F2F7FC;
                }
                #fancybox-wrap{

                }
                .fields_input{
                    float: left;
                    margin-top: 8px;
                    width: 100%;
                }
                .button-link{
                    border:0;
                    background:url(../images/bg_submit.gif) repeat-x;
                    width:134px;
                    float:right;
                    margin:19px 0 10px 0;
                    color:#ffffff;
                    font-size:14px;
                    font-weight:bold;
                    cursor:pointer;
                    border-radius:5px;
                    box-shadow:0 2px 3px #666666;
                    padding:8px 0;
                    text-transform:uppercase;
                }
                .customer-box{
                    float:left; width:604px; margin-left:25px;
                    border:1px solid #CCCCCC;
                    padding:18px 0px 10px 0px;
                    background: #E5E8EA;
                    border-top: none;

                }
                .customer-box label{
                    width:90px;
                    text-align: right;
                    float:left;
                }
                input{
                    float:left;
                    margin-left:9px;
                }
/*                select{
                    float:left;
                    height: 21px;
                    width:166px;
                    margin-left:9px;
                }*/
                .ui-datepicker-header select{
                    width:45% !important;
                }
                .header-box{
                    margin-left:25px;
                    color:#263340;
                    margin-top:10px;
                    float: left;
                    cursor:pointer;
                    padding:4px 0px 0px 4px; 
                    width:600px;
                    border:1px solid #CCCCCC;
                    font-size:12px;
                    background: #D4D7D8;
                    height: 21px;
                    font-weight: bold;
                }
                .fixdate .ui-datepicker-trigger  { margin-left: 4px;}

                .boder-bomttom{

                }
               
                .mail_sms{
                    float: right;
                    margin-right: -19px;
                    margin-top: 5px;
                }
                /*                .buttonsave {
                                    background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                                    border: 0 none;
                                    color: white;
                                    cursor: pointer;
                                    float: left;
                                    font-size: 10px;
                                    font-weight: bold;
                                    height: 13px;
                                    margin-bottom: 5px;
                                    margin-right: 20px;
                                    margin-top: 3px;
                                    padding: 3px 7px;
                                    text-transform: uppercase;
                                    width: auto;
                                }*/
                .mesage{
                    color: red;
                    float: left;
                    margin-left: 252px;
                    margin-top: 20px;
                    text-transform: uppercase;
                    width: 400px !important;

                }
                .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
              
                .updateV500{
                    color:#fff;
                    text-align: left;
                    margin-left:8px;
                    cursor: pointer;
                    width:95% !important;
                }.updateq400{
                    color:#fff;
                    text-align: left;
                    margin-left:8px;
                    cursor: pointer;
                    width:95% !important;
                }
                .group_list_cus_tour {
                    overflow-y: auto;
                    height:300px;
                }
            </style>
            <style type="text/css">
                #fancybox-wrap{

                }
                .button-link{
                    border:0;
                    background:url(../images/bg_submit.gif) repeat-x;
                    width:134px;
                    float:right;
                    margin:19px 0 10px 0;
                    color:#ffffff;
                    font-size:14px;
                    font-weight:bold;
                    cursor:pointer;
                    border-radius:5px;
                    box-shadow:0 2px 3px #666666;
                    padding:8px 0;
                    text-transform:uppercase;
                }
                div.rateit div.rateit-reset {

                    width:0px !important;
                }
                .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
               
                .buttonsearch2{
                    border:0;
                    background:url(../images/bg_submit.gif) repeat-x;
                    width:68px;

                    margin:0px 0 10px 20px;
                    color:#ffffff;
                    font-size:12px;
                    font-weight:bold;
                    cursor:pointer;
                    border-radius:2px;
                    padding:4px 0;
                    text-transform:uppercase;
                }
                input{
                    float:left;
                    margin-left:9px;
                }
/*                select{
                    float:left;
                    height: 21px;
                    width:166px;
                    margin-left:9px;
                }*/
                .ui-datepicker-header select{
                    width:45% !important;
                }
                .group_list_cus{

                }
                .contact_content{
                    float:left;
                    padding-left: 5px;
                    font-style: italic;

                }
                .contact_lable{
                    float:left;
                    text-align: right;
                    width: 70px;
                }
                .contact_contact{
                    float:left;                    
                    width: 280px;
                }
                .fields_info {
                    float: left;
                    line-height: 18px;
                    margin-left: 11px;
                    width: 200px !important;
                }
                .fields_contact {
                    float: left;
                    line-height: 18px;
                    width: 280px !important;
                }
                .vv031{
                   margin-left: -3px;
                }
            </style>
    </head>
    <f:view>
        
        <body style=" float:left; width:auto; height:auto; margin:0px;overflow: hidden;margin-top:150px;">
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:inputHidden id="fn050" value="#{v030Controller.FV050}" />
            <div class="popup" style="height:412px; width:760px;margin-top:5px; margin-right: 12px ">
                <div class="popup-header">
                    <div class="title"><h:outputText value="Khách hàng cá nhân"/></div>
                    <div style=" position: fixed; float:left; height:10px;width:50px;left:708px;">
                        <h:panelGroup rendered="#{v030Controller.flag ==1 }">
                            <a id="fancybox-close" onclick="self.parent.location='customer4tour.jsp?status=T&pv050=<h:outputText rendered="#{v030Controller.tipTour!=0}" value="#{v030Controller.tipTour}"/><h:outputText rendered="#{v030Controller.tipTour==0}" value="#{v030Controller.FV050}"/>'"  style="display: block; float:left;"></a>
                        </h:panelGroup>
                        <h:panelGroup rendered="#{v030Controller.flag !=1}">
                            <a id="fancybox-close" onclick="self.parent.tb_remove()"  style="display: block; float:left;"></a>
                        </h:panelGroup>

                    </div>
                </div>
                <jsp:include page="listCustomer4Tour.jsp" />
                
              

            </div>
        </body>

    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        //yhight = ($j('.popup').height()-90)+"px" ;
        //$j('.main_content').css('height',yhight + 50);
        //$j('.popup-content').css('height',yhight + 50);
    });
</script>

